<template>
	 <uni-nav-bar title="支付完成" left-icon="left" @clickLeft="navBack" :fixed="true" statusBar></uni-nav-bar>
	 <Process :state="'3'"></Process>
	 <view class="package success">
		 <view>支付成功</view>
	 	 <image :src="succeeded" mode=""></image>
	 </view>
	 <view class="package" v-if="teamList&&teamList.length>0">
		 <view class="text">该团惠包已经分享到您车友团，车友每购买一单您将得到奖励。
		 </view>
		 <view class="space-between teamList" v-for="(item,index) in teamList" :key="index">
			 <view class="center team">
				 <image :src="Teammap1" mode=""></image>
				 <text>{{item.team_name}}</text>
			 </view>
			 <uni-icons type="checkbox" size="22" color="#1B91FF"></uni-icons> 
		 </view>
	 </view>
	 <view class="bottom"> 
		 <text @click="redirectTo('order/myStock')">我的存货</text>
		 <text @click="redirectTo('groupBenefits/groupDetails?id='+baoID+'&type=buy')">团惠包详情</text>
	 </view>
</template>

<script setup lang="ts">
	import { navBack,redirectTo } from '@/utils/navigator';
	import Process from '@c/groupBenefits/process.vue';
	import {sussTeam} from '@/gql/group';
	import { succeeded,Teammap1 } from '@/utils/Static';
	import {toPublish} from '@mqtt';
	import { onLoad } from '@dcloudio/uni-app';
	import { ref } from 'vue';
	const orderId=ref('')
	const baoID=ref('')
	const teamList=ref([])
	onLoad((pearm)=>{
		orderId.value=pearm.id
		baoID.value=pearm.baoId
		const payload = {
			query: sussTeam,
			variables: {
				order_id:Number(pearm.id)
			},
		};
		toPublish('ql/store/getOrderBaoFenxiang', payload, (obj: any) => {
			const {team_list} = obj.data;
			teamList.value=team_list
		});
	})
</script>

<style scoped lang="less">
	@import url('../groupBenefits/less/groupSuccess.less');
</style>